package com.lcf.mulit.controller;

import com.lcf.mulit.test01.service.UserService;
import com.lcf.mulit.test02.service.UserService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserService userService01;

    @Autowired
    private UserService2 userService02;

    @GetMapping("/test01/{name}/{age}")
    public Integer insertUser(@PathVariable("name") String name, @PathVariable("age") Integer age) {
        Integer integer = userService01.insertUser(name, age);
        return integer;
    }

    @GetMapping("/test02/{name}/{age}")
    public Integer insertUser2(@PathVariable("name") String name, @PathVariable("age") Integer age) {
        Integer integer = userService02.insertUser(name, age);
        return integer;
    }
}
